﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved 
//Contact jon.norton@fin-plus.co.uk website <http://www.fin-plus.co.uk/>
using FinPlusCompCore;
using QLNet;

namespace FinPlusCompQuant
{
    public class CdsSpread : FinPlusComponent
    {
        //construct
        public CdsSpread(Market market, string name, double spread, double recoveryRate, string tenor, int fixingDays, string dicountCurveName, string freq, string dayCount, string bizConv, string holidays, bool endOfMonth = true)
        {

            Id = name;

            //TODO QLNet has no cds deafult etc
            //if(!discountCurve) return "#cant find discount curve";
		    //boost::shared_ptr<DefaultProbabilityHelper> cds(new SpreadCdsHelper(setQuote(marketName, instName, spread), getPeriod(tenor), fixingDays, Holidays(holidays), Freq(freq), BizConv(bizConv), DateGeneration::TwentiethIMM, DayCount(dayCount), recoveryRate, Handle<QuantLib::YieldTermStructure>(discountCurve)));	
		    //defaultHelpers[marketName][instName] = cds;
        }
    }
}
